class Solution {
    public static int removeElement(int[] nums, int val) {
        int slow = 0;
        for (int fast = 0; fast < nums.length; fast++) {
            if (nums[fast] != val) {
                nums[slow++] = nums[fast];
            }
        }
        return slow;
    }

    public static void main(String[] args) {
        int[] array = {3,2,1,5,3,7};
        int ret = removeElement(array,3);
        System.out.println(ret);
    }
}